
#include <iostream>
#include "Comm.hpp"
using namespace std;

class Client
{
public:
    Client()
        : _fd(gdeafultfd)
    {}

    // 打开管道
    bool OpenPipeForWrite()
    {
        _fd = OpenPipe(gForWrite);
        if (_fd < 0)
            return false;
        return true;
    }

    // 向管道发
    int SendPipe(const string &in)
    {
        return ::write(_fd, in.c_str(), in.size());
    }

    // 关闭管道
    void ClosePipe()
    {
        ClosePipeHelper(_fd);
    }

    ~Client()
    {  }

private:
    int _fd;
};